package router

import (
	"github.com/gin-gonic/gin"

	"mxshop-api/goods-web/api/banner"
	"mxshop-api/goods-web/global"
	"mxshop-api/shared/auth"
)

func InitBannerRouter(router *gin.RouterGroup) {
	signingKey := global.ServerConfig.SigningKey
	BannerRouter := router.Group("/banner")
	{
		BannerRouter.GET("", banner.List)
		BannerRouter.POST("", auth.Middleware(signingKey), auth.IsAdminUser(), banner.New)
		BannerRouter.PUT("/:id", auth.Middleware(signingKey), auth.IsAdminUser(), banner.Update)
		BannerRouter.DELETE("/:id", auth.Middleware(signingKey), auth.IsAdminUser(), banner.Delete)
	}
}
